Skip to content

Add customizable worktree branch naming#1110

Open
benmarg wants to merge 2 commits intopingdotgg:mainfrom
benmarg:t3code/custom-branch-naming-modes
Open

Add customizable worktree branch naming#1110
benmarg wants to merge 2 commits intopingdotgg:mainfrom
benmarg:t3code/custom-branch-naming-modes

Conversation

@benmarg
Copy link

@benmarg benmarg commented Mar 15, 2026

What Changed

There's now a dropdown in the bottom of the editor that allows you to select between three different Branch Naming modes: Auto, Prefix, and Custom

"Auto Branch Name" is the same as the current behavior
"Prefix" allows you to change the prefix from t3code to whatever you'd like, so for example "feat". T3code will still rename the part after the prefix when you go to create a PR.
"Custom Branch Name" allows you to totally override the branch name and do whatever you'd like with a static branch name

The menu goes away after you create the thread

Side note:

Adding tests bulked up the line count so it's a bit of a bigger PR but please don't ban me 😅, just close the PR if you think it's too big

Why

Using the default t3code prefix isn't always desired. A key workflow this is blocking for me is using the default branch name that Linear provides when creating a worktree, so the branch can automatically be tied to the ticket by Linear.

UI Changes

Previous:
Screenshot 2026-03-14 at 11 50 31 PM

New:
image
image

Screen.Recording.2026-03-14.at.11.40.55.PM.mov

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add customizable worktree branch naming with auto, prefix, and full modes

  • Introduces a GitWorktreeBranchNaming contract schema (auto/prefix/full modes) in git.ts and shared utilities in shared/src/git.ts for building and detecting temporary branch names.
  • Adds a branch naming selector UI to BranchToolbar.tsx so users can choose auto, a custom prefix, or a fully explicit branch name when creating a new worktree.
  • Persists the chosen naming config through the full stack: draft store → thread.create command → thread.created event → projection_threads.worktree_branch_naming_json column (added in migration 014).
  • Replaces inline branch detection logic in ProviderCommandReactor.ts with the new shared buildFinalWorktreeBranchName and isTemporaryWorktreeBranchName utilities.
  • Behavioral Change: existing rows are backfilled to {"mode":"auto"} by the migration; the repository now emits decode errors if the stored JSON is invalid.

Macroscope summarized d0e6cec.

@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d6b5bf01-0a2b-441d-bc03-5995eb6ae94e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can customize the tone of the review comments and chat replies.

Configure the tone_instructions setting to customize the tone of the review comments and chat replies. For example, you can set the tone to Act like a strict teacher, Act like a pirate and more.

@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 15, 2026
@maria-rcks maria-rcks added needs-julius enhancement Requested improvement or new capability. labels Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Requested improvement or new capability. needs-julius size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants